package com.kyrie.annotation;

import com.kyrie.aop.EnumValidatorClass;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/***
 * 描述: 自定义枚举参数校验注解
 *
 * @author wuxiang
 * @date 2020-04-21 17:12
 */

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD,ElementType.METHOD})
@Constraint(validatedBy = EnumValidatorClass.class)
public @interface EnumValidator {
    Class<?> value();

    String message() default "传入参数不在指定的枚举中";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };
}
